Skip to content

Enhance observability in core modules via descriptive error handling#5195

Open
saishmungase wants to merge 1 commit intosugarlabs:masterfrom
saishmungase:chore/refactor-error-logs
Open

Enhance observability in core modules via descriptive error handling#5195
saishmungase wants to merge 1 commit intosugarlabs:masterfrom
saishmungase:chore/refactor-error-logs

Conversation

@saishmungase
Copy link

Hi everyone!

While working through the core modules, I noticed several instances where JSON parsing or state restoration failures were being "swallowed" by generic console logs. This makes debugging difficult, especially as we look toward porting logic for the v4 foundational rebuild.

What this PR does:

  • Adds Context: Replaces generic console.log(e) with descriptive strings (e.g., "Error clearing palettes:" or "ProjectStorage: Failed to parse JSON data for key...").
  • Standardizes Logging: Uses console.error() so issues are correctly categorized in dev tools.
  • Clean Code: Removes the // eslint-disable-next-line no-console workarounds, ensuring we follow the project's linting standards without overrides.

Verification:

I've run the full test suite locally:

  • Tests Passed: 2,275
  • Test Suites Passed: 88
  • Environment: Local Node.js / Jest

The refactored logs were triggered during test runs (e.g., in palette.test.js), confirming that the added context is appearing correctly in the output.

Closes #5194

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

✅ All Jest tests passed! This PR is ready to merge.

@saishmungase
Copy link
Author

Hi team,

I’ve updated the PR to resolve the CI check for the translation files.

This implementation fully addresses the requirements outlined in Issue #5194 by:

  1. Refactoring generic console.log(e) calls to console.error.
  2. Adding contextual strings (e.g., "ProjectStorage: Failed to...") to ensure logs are traceable in the console.
  3. Removing the eslint-disable overrides as requested.

Ready for review! Thanks.

@vanshika2720
Copy link
Contributor

@saishmungase resolve merge conflicts.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@saishmungase saishmungase force-pushed the chore/refactor-error-logs branch from cd029cf to 83c5c8d Compare February 24, 2026 06:28
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@saishmungase saishmungase reopened this Feb 24, 2026
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@saishmungase
Copy link
Author

Hi everyone! I wanted to give a quick update. I’ve fixed the merge conflicts, and the branch is fully up to date. Let me know if you need anything else from me. Thank you for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor generic error logs and remove eslint-disable in core modules.

2 participants